import 'package:flutter/cupertino.dart';

import '../../data/consts/Difficulty.dart';
import '../../data/consts/level.dart';
import '../../data/consts/version.dart';


class FilterModel extends ChangeNotifier {
  var versionId;
  var difficulty;
  var level;

  void onVersionSelected(Version? version) {
    if (version != null) {
      versionId = version.versionId;
    } else {
      versionId = null;
    }
    notifyListeners();
  }

  void onDifficultySelected(Difficulty? difficulty) {
    if (difficulty != null) {
      this.difficulty = difficulty;
    } else {
      this.difficulty = null;
    }
    notifyListeners();
  }

  void onLevelSelected(Level? level) {
    if (level != null) {
      this.level = level.value;
    } else {
      this.level = null;
    }
    notifyListeners();
  }
}